﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    internal class MyIEnumerable : IEnumerable
    {
        private string[] _strs;
        public MyIEnumerable(string[] strs) { _strs = strs; }
        public IEnumerator GetEnumerator()
        {
            return new MyIEnumerator(_strs);
        }
        }
    internal class MyIEnumerator : IEnumerator
    {
        private string[] _strs;
        private int _position;
        public MyIEnumerator(string [] strs)
        {
            _strs = strs;
            _position = -1;
        }
        public object Current
        {
            get
            {
                return _strs[_position];
            }
        }

        public bool MoveNext()
        {
            _position++;
            return _position < _strs.Length;
        }

        public void Reset()
        {
            _position=-1;
        }
    }
}
